<%@ page language="java" contentType="text/html; charset=UTF-8"
		 pageEncoding="UTF-8"%>
<%String path = request.getContextPath() ;%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c"%>
<%@ taglib uri="/WEB-INF/tld/ui.tld" prefix="ui"%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
	<c:set var="ctx" value="${pageContext.request.contextPath}" />
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>周转换率详情</title>
	<jsp:include page="../../import.jsp" flush="true" />
</head>
<body class="iframeBody">
<div class="Wrapper">
	<div id="pageInTab" class="pageInTab">
		<div tabid="tabA" title="周转换率详情" lselected="true">
			<form id="formSet1" class="l-form">
				<div class="sqPanel">
					<div class="sqPanel_head inL">
						<span></span>
					</div>
					<div class="sqPanel_body">
						<div id="ligergrid_A1" class="sq-grid"></div>
					</div>
				</div>
			</form>
		</div>
		<%--<div tabid="tabB" title="" id="tabBId">
			<iframe frameborder="0" name="tabB" id="tabB" src=""></iframe>
		</div>--%>
	</div>
</div>
<script type="text/javascript">
	var limRateGrid=null,
			splId='${splId}';

	var pageInApp={
		flag:true
	}; // to 下一级子窗口 接口
	var pageInTab=null;
	var loadedTabs=[]
	$(function(){
		initTab();

		$('#formSet1').ligerForm({
			validate : true
		});
		initLimRateGrid();
	});

	//初始化转换率详情
	function initLimRateGrid() {
		if(!splId){//供应商ID为空
			return;
		}
		limRateGrid = $("#ligergrid_A1").ligerGrid({
			url: '<%=path%>/product/splInfo/getSplLimRateListBySplId.do?',
			method : 'get',
			parms:{splId:splId},
			async: false,
			columns: [
				{
					display: '跑批时间', name: 'crtTm', minWidth: 150,
					render : function (rowdata, index, value) {
						return renderDate(rowdata, index, value);
					}
				},
				{ display: '近三个月查询客户总量(非C级)', name: 'secCstNum', width: 200},
				{ display: '近三个月成交客户量(我司放款)', name: 'makeDealNum', width: 200},
				{ display: '周转换率%', name: 'slewRate', width: 80,
					render : function (rowdata, index, value) {
						return value + '%';
					}
				},
				{ display: '是否合规', name: 'isAccordRul', width: 70,
					render : function (rowdata, index, value) {
						if (1 == value) {
							return '是'
						} else {
							return '否'
						}
					}
				},
				{ display: '是否有权查询征信', id: 'isAuthCrdChk', width: 70,
					render : function (rowdata, index, value) {
						if (1 == value) {
							return '是'
						} else {
							return '否'
						}
					}
				},
				{ display: '操作者', id: 'crtUsrNm', width: 300 ,
					render : function (rowdata, index, value) {
						return rowdata.crtUsrNm;
					}
				}
			],
			pageSize:10,
	        root:'rows',
	        record:'total',
	        hideLoadButton : true,
	        width: '100%',
	        height: '100%',
			heightDiff: -2,
	        isScroll: false,
	        checkbox:false,
	        rownumbers:true,
	        allowUnSelectRow: true,
			alternatingRow: false,
			enabledSort:false,
			onAfterShowData: function() {
				SetIframe_height ();
			},
	        onRenderComplete: function () {
	        	iframeResize ();
	        },
		});
	};

	//格式化时间
	function renderDate(rowdata, index, value) {
		var dateStr = "";
		if (null != value) {
			var date = new Date(value);
			dateStr = DateUtils.formatDate(date, DateUtils.YYYY_MM_DDHHMMSS);
		}
		return dateStr;
	}

	function iframeResize () {
	    if (parent.parent.mainApp) {
	        parent.parent.mainApp.parentTab.onResize();
	    };
	};
	
	//初始化Tab
	function initTab(){
		pageInTab = $("#pageInTab").ligerTab({
			height: 'auto',
			contextmenu: false,
			minIframeHeight: GET_minIframeHeight(),
			onBeforeSelectTabItem: function (tabid) {
				if(tabid!="tabA"){

				}
			},
			onAfterSelectTabItem: function(tabid) {
				if (loadedTabs.indexOf(tabid)<0) {
					loadedTabs.push(tabid);
					switch (tabid){
						case "tabB":
							pageInTab.setTabItemSrc(tabid, "");
							break;
					}
				};
				SetIframe_height();
			}
		});

		$.extend(true, pageInApp, {
			pageInTab: pageInTab
		});
	};
</script>
</body>
</html>
